/*
 Navicat Premium Data Transfer

 Source Server         : localhost_3306_root1234
 Source Server Type    : MySQL
 Source Server Version : 80031 (8.0.31)
 Source Host           : localhost:3306
 Source Schema         : school

 Target Server Type    : MySQL
 Target Server Version : 80031 (8.0.31)
 File Encoding         : 65001

 Date: 25/03/2025 11:14:00
*/

SET NAMES utf8mb4;
SET FOREIGN_KEY_CHECKS = 0;

-- ----------------------------
-- Table structure for Course
-- ----------------------------
DROP TABLE IF EXISTS `Course`;
CREATE TABLE `Course` (
  `CId` char(8) NOT NULL,
  `Cname` varchar(255) DEFAULT NULL,
  `TId` char(10) NOT NULL,
  PRIMARY KEY (`CId`),
  CONSTRAINT `course_chk_1` CHECK (((length(`CId`) = 8) and (not((`Cname` like _utf8mb4'%[0-9]%')))))
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_ai_ci;

-- ----------------------------
-- Records of Course
-- ----------------------------
BEGIN;
INSERT INTO `Course` (`CId`, `Cname`, `TId`) VALUES ('20230001', '语文', '1002');
INSERT INTO `Course` (`CId`, `Cname`, `TId`) VALUES ('20230002', '数学', '1003');
INSERT INTO `Course` (`CId`, `Cname`, `TId`) VALUES ('20230003', '英语', '1001');
COMMIT;

-- ----------------------------
-- Table structure for SC
-- ----------------------------
DROP TABLE IF EXISTS `SC`;
CREATE TABLE `SC` (
  `SId` varchar(10) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci NOT NULL,
  `CId` char(8) NOT NULL,
  `score` int DEFAULT NULL,
  PRIMARY KEY (`SId`,`CId`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_ai_ci;

-- ----------------------------
-- Records of SC
-- ----------------------------
BEGIN;
INSERT INTO `SC` (`SId`, `CId`, `score`) VALUES ('202312001', '20230001', 65);
INSERT INTO `SC` (`SId`, `CId`, `score`) VALUES ('202312001', '20230002', 71);
INSERT INTO `SC` (`SId`, `CId`, `score`) VALUES ('202312001', '20230003', 68);
INSERT INTO `SC` (`SId`, `CId`, `score`) VALUES ('202312002', '20230001', 62);
INSERT INTO `SC` (`SId`, `CId`, `score`) VALUES ('202312002', '20230002', 67);
INSERT INTO `SC` (`SId`, `CId`, `score`) VALUES ('202312002', '20230003', 72);
INSERT INTO `SC` (`SId`, `CId`, `score`) VALUES ('202312003', '20230001', 51);
INSERT INTO `SC` (`SId`, `CId`, `score`) VALUES ('202312003', '20230002', 59);
INSERT INTO `SC` (`SId`, `CId`, `score`) VALUES ('202312003', '20230003', 56);
INSERT INTO `SC` (`SId`, `CId`, `score`) VALUES ('202312004', '20230001', 43);
INSERT INTO `SC` (`SId`, `CId`, `score`) VALUES ('202312004', '20230002', 85);
INSERT INTO `SC` (`SId`, `CId`, `score`) VALUES ('202312004', '20230003', 74);
INSERT INTO `SC` (`SId`, `CId`, `score`) VALUES ('202312005', '20230001', 55);
INSERT INTO `SC` (`SId`, `CId`, `score`) VALUES ('202312005', '20230002', 48);
INSERT INTO `SC` (`SId`, `CId`, `score`) VALUES ('202312005', '20230003', 56);
INSERT INTO `SC` (`SId`, `CId`, `score`) VALUES ('202312006', '20230001', 79);
INSERT INTO `SC` (`SId`, `CId`, `score`) VALUES ('202312006', '20230002', 71);
INSERT INTO `SC` (`SId`, `CId`, `score`) VALUES ('202312006', '20230003', 89);
INSERT INTO `SC` (`SId`, `CId`, `score`) VALUES ('202312007', '20230001', 48);
INSERT INTO `SC` (`SId`, `CId`, `score`) VALUES ('202312007', '20230002', 58);
INSERT INTO `SC` (`SId`, `CId`, `score`) VALUES ('202312007', '20230003', 77);
INSERT INTO `SC` (`SId`, `CId`, `score`) VALUES ('202312008', '20230001', 82);
INSERT INTO `SC` (`SId`, `CId`, `score`) VALUES ('202312008', '20230002', 55);
INSERT INTO `SC` (`SId`, `CId`, `score`) VALUES ('202312008', '20230003', 77);
INSERT INTO `SC` (`SId`, `CId`, `score`) VALUES ('202312009', '20230001', 74);
INSERT INTO `SC` (`SId`, `CId`, `score`) VALUES ('202312009', '20230002', 83);
INSERT INTO `SC` (`SId`, `CId`, `score`) VALUES ('202312009', '20230003', 43);
COMMIT;

-- ----------------------------
-- Table structure for Student
-- ----------------------------
DROP TABLE IF EXISTS `Student`;
CREATE TABLE `Student` (
  `SId` varchar(10) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci NOT NULL,
  `Sname` varchar(10) DEFAULT NULL,
  `Sage` datetime DEFAULT NULL,
  `Ssex` enum('男','女') DEFAULT NULL,
  PRIMARY KEY (`SId`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_ai_ci;

-- ----------------------------
-- Records of Student
-- ----------------------------
BEGIN;
INSERT INTO `Student` (`SId`, `Sname`, `Sage`, `Ssex`) VALUES ('202312001', '郝一', '1990-01-01 00:00:00', '男');
INSERT INTO `Student` (`SId`, `Sname`, `Sage`, `Ssex`) VALUES ('202312002', '刘二', '1992-01-16 00:00:00', '女');
INSERT INTO `Student` (`SId`, `Sname`, `Sage`, `Ssex`) VALUES ('202312003', '张三', '1996-11-13 00:00:00', '男');
INSERT INTO `Student` (`SId`, `Sname`, `Sage`, `Ssex`) VALUES ('202312004', '李四', '1997-12-06 00:00:00', '女');
INSERT INTO `Student` (`SId`, `Sname`, `Sage`, `Ssex`) VALUES ('202312005', '王五', '1993-08-18 00:00:00', '男');
INSERT INTO `Student` (`SId`, `Sname`, `Sage`, `Ssex`) VALUES ('202312006', '赵六', '2017-12-23 00:00:00', '男');
INSERT INTO `Student` (`SId`, `Sname`, `Sage`, `Ssex`) VALUES ('202312007', '孙七', '2000-08-05 00:00:00', '女');
INSERT INTO `Student` (`SId`, `Sname`, `Sage`, `Ssex`) VALUES ('202312008', '周八', '1999-03-01 00:00:00', '男');
INSERT INTO `Student` (`SId`, `Sname`, `Sage`, `Ssex`) VALUES ('202312009', '钱九', '2013-05-22 00:00:00', '女');
COMMIT;

-- ----------------------------
-- Table structure for Teacher
-- ----------------------------
DROP TABLE IF EXISTS `Teacher`;
CREATE TABLE `Teacher` (
  `TId` char(10) NOT NULL,
  `Tname` varchar(255) DEFAULT NULL,
  PRIMARY KEY (`TId`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_ai_ci;

-- ----------------------------
-- Records of Teacher
-- ----------------------------
BEGIN;
INSERT INTO `Teacher` (`TId`, `Tname`) VALUES ('1001', '刘老师');
INSERT INTO `Teacher` (`TId`, `Tname`) VALUES ('1002', '胡老师');
INSERT INTO `Teacher` (`TId`, `Tname`) VALUES ('1003', '李老师');
COMMIT;

SET FOREIGN_KEY_CHECKS = 1;
